1. Field of the Invention
The present invention relates to automatic program conversion devices capable of analyzing computer programs and converting them in part or whole.
2. Description of the Related Art
Conventionally, several techniques have been employed for the automatic conversion of computer programs, and those that are for source programs and program scripts can be cited to begin with. In these conversion techniques, differences in description are automatically detected by obtaining compiler differences, and are automatically modified or a list is made thereof to improve efficiency in development. With them, a source program written in C language is parsed into tokens, and a database as well as an intermediate file is created for each token. Then relevant character strings are removed from or modified in the database to create a C language file from the information in the database and intermediate file, and thereby a target program is generated.
Secondly, another technique that may be cited is one in which based on program objects developed on a certain computer, software executable on another platform is automatically generated. In this technique, object code that can be executed under the computer resources provided is divided by a segment divider into an instruction code area and a data code area. Then the instruction code area is analyzed for instruction sets and OS primitives by an instruction code converter for conversion into statements written in a high-level programming language, while the data code area is checked on a data type that corresponds to a type of the instruction referencing, and then the data code area is converted by a data syntax converter into data definitions written in the high-level programming language. Then, using a reference area converter, the data definitions are assigned reference names, and are converted into a form in which the statements refer to the reference names. In this manner a high-level language program is generated.
With the first conventional technique, however, the premise is that conversion is automatically performed on every instruction that falls within the scope of the specification of a programming language used to write the source program to be converted. In terms of the second conventional technique, presumably, every program object present on a certain computer is subjected to automatic conversion.
In other words, it is not taken into account in either technique that a program in question will still be efficiently executable after being transferred to a different operating environment, so as to ensure that program's operating environment. Therefore, with the conventional techniques, which instruction patterns should undergo automatic or manual conversion is not distinguishable at all. This means that when developing an automatic conversion program capable of converting a program in a full- or semi-automatic manner, a programmer relying on the conventional techniques is unable to decide, in pursuit of conversion efficiency, which instruction pattern he or she should work on within a source program. Specifically, when using the conventional techniques, presumably, one has no choice but to develop a program that automatically converts even instruction patterns appearing only once.